package net.hn.hnms.biz.safety.monitor.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Objects;

/**
 * 智呈物联 pan'sx
 * 2022/8/30 19:58
 * 1.0 version
 */
@Entity
@Table(name = "dwd_aqjk_now_sensormonitor", schema = "aqjk", catalog = "huaneng-safety")
@ApiModel("安全监控实时值")
public class AqjkNowSensorMonitorEntity {
    @Id
    private Long id;
    private String mineCode;
    @ApiModelProperty("传感器编码")
    private String pointCode;
    @ApiModelProperty("数据时间")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "Asia/Shanghai"
    )
    private Timestamp dataTime;
    private String sensorType;
    @ApiModelProperty("传感器类型")
    private String sensorTypeName;
    @ApiModelProperty("传感器位置")
    private String pointLocation;
    @ApiModelProperty("监测值")
    private BigDecimal pointValue;
    @ApiModelProperty("状态码")
    private String pointStatus;
    private String valueUnit;
    private Timestamp createTime;
    @ApiModelProperty("设备状态")
    @Transient
    private String status;
    @Transient
    public String getStatus() {
        return status;
    }
    @Transient
    public void setStatus(String status) {
        this.status = status;
    }

    @Basic
    @Column(name = "id")
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }
    @Basic
    @Column(name = "mine_code")
    public String getMineCode() {
        return mineCode;
    }

    public void setMineCode(String mineCode) {
        this.mineCode = mineCode;
    }

    @Basic
    @Column(name = "point_code")
    public String getPointCode() {
        return pointCode;
    }

    public void setPointCode(String pointCode) {
        this.pointCode = pointCode;
    }

    @Basic
    @Column(name = "data_time")
    public Timestamp getDataTime() {
        return dataTime;
    }

    public void setDataTime(Timestamp dataTime) {
        this.dataTime = dataTime;
    }

    @Basic
    @Column(name = "sensor_type")
    public String getSensorType() {
        return sensorType;
    }

    public void setSensorType(String sensorType) {
        this.sensorType = sensorType;
    }

    @Basic
    @Column(name = "sensor_type_name")
    public String getSensorTypeName() {
        return sensorTypeName;
    }

    public void setSensorTypeName(String sensorTypeName) {
        this.sensorTypeName = sensorTypeName;
    }

    @Basic
    @Column(name = "point_location")
    public String getPointLocation() {
        return pointLocation;
    }

    public void setPointLocation(String pointLocation) {
        this.pointLocation = pointLocation;
    }

    @Basic
    @Column(name = "point_value")
    public BigDecimal getPointValue() {
        return pointValue;
    }

    public void setPointValue(BigDecimal pointValue) {
        this.pointValue = pointValue;
    }

    @Basic
    @Column(name = "point_status")
    public String getPointStatus() {
        return pointStatus;
    }

    public void setPointStatus(String pointStatus) {
        this.pointStatus = pointStatus;
    }

    @Basic
    @Column(name = "value_unit")
    public String getValueUnit() {
        return valueUnit;
    }

    public void setValueUnit(String valueUnit) {
        this.valueUnit = valueUnit;
    }

    @Basic
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        AqjkNowSensorMonitorEntity that = (AqjkNowSensorMonitorEntity) o;
        return Objects.equals(mineCode, that.mineCode) &&
                Objects.equals(pointCode, that.pointCode) &&
                Objects.equals(dataTime, that.dataTime) &&
                Objects.equals(sensorType, that.sensorType) &&
                Objects.equals(sensorTypeName, that.sensorTypeName) &&
                Objects.equals(pointLocation, that.pointLocation) &&
                Objects.equals(pointValue, that.pointValue) &&
                Objects.equals(pointStatus, that.pointStatus) &&
                Objects.equals(valueUnit, that.valueUnit) &&
                Objects.equals(createTime, that.createTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(mineCode, pointCode, dataTime, sensorType, sensorTypeName, pointLocation, pointValue, pointStatus, valueUnit, createTime);
    }
}
